import { useState } from 'react';

export default function useBool(initValue = false) {
	const [bool, setBool] = useState(initValue);

	function setTrue() {
		setBool(true);
	}
	function setFalse() {
		setBool(false);
	}
	function toggle() {
		setBool(state => !state);
	}

	return {
		bool,
		setBool,
		setFalse,
		setTrue,
		toggle
	};
}
